<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>dynamic_string_buffer::prepare</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../boost_asio.html" title="Boost.Asio">
<link rel="up" href="../dynamic_string_buffer.html" title="dynamic_string_buffer">
<link rel="prev" href="mutable_buffers_type.html" title="dynamic_string_buffer::mutable_buffers_type">
<link rel="next" href="shrink.html" title="dynamic_string_buffer::shrink">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="mutable_buffers_type.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dynamic_string_buffer.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="shrink.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_asio.reference.dynamic_string_buffer.prepare"></a><a class="link" href="prepare.html" title="dynamic_string_buffer::prepare">dynamic_string_buffer::prepare</a>
</h4></div></div></div>
<p>
          <a class="indexterm" name="boost_asio.indexterm.dynamic_string_buffer.prepare"></a> 
<span class="bold"><strong>DynamicBuffer_v1:</strong></span> Get a list of buffers that represents
          the output sequence, with the given size.
        </p>
<pre class="programlisting"><span class="identifier">mutable_buffers_type</span> <span class="identifier">prepare</span><span class="special">(</span>
    <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">n</span><span class="special">);</span>
</pre>
<p>
          Ensures that the output sequence can accommodate <code class="computeroutput"><span class="identifier">n</span></code>
          bytes, resizing the basic_string object as necessary.
        </p>
<h6>
<a name="boost_asio.reference.dynamic_string_buffer.prepare.h0"></a>
          <span class="phrase"><a name="boost_asio.reference.dynamic_string_buffer.prepare.return_value"></a></span><a class="link" href="prepare.html#boost_asio.reference.dynamic_string_buffer.prepare.return_value">Return
          Value</a>
        </h6>
<p>
          An object of type <code class="computeroutput"><span class="identifier">mutable_buffers_type</span></code>
          that satisfies MutableBufferSequence requirements, representing basic_string
          memory at the start of the output sequence of size <code class="computeroutput"><span class="identifier">n</span></code>.
        </p>
<h6>
<a name="boost_asio.reference.dynamic_string_buffer.prepare.h1"></a>
          <span class="phrase"><a name="boost_asio.reference.dynamic_string_buffer.prepare.exceptions"></a></span><a class="link" href="prepare.html#boost_asio.reference.dynamic_string_buffer.prepare.exceptions">Exceptions</a>
        </h6>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">std::length_error</span></dt>
<dd><p>
                If <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span>
                <span class="special">+</span> <span class="identifier">n</span>
                <span class="special">&gt;</span> <span class="identifier">max_size</span><span class="special">()</span></code>.
              </p></dd>
</dl>
</div>
<h6>
<a name="boost_asio.reference.dynamic_string_buffer.prepare.h2"></a>
          <span class="phrase"><a name="boost_asio.reference.dynamic_string_buffer.prepare.remarks"></a></span><a class="link" href="prepare.html#boost_asio.reference.dynamic_string_buffer.prepare.remarks">Remarks</a>
        </h6>
<p>
          The returned object is invalidated by any <code class="computeroutput"><span class="identifier">dynamic_string_buffer</span></code>
          or <code class="computeroutput"><span class="identifier">basic_string</span></code> member
          function that modifies the input sequence or output sequence.
        </p>
</div>
<div class="copyright-footer">Copyright © 2003-2025 Christopher M.
      Kohlhoff<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="mutable_buffers_type.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dynamic_string_buffer.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="shrink.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
